Page({
  data: {
    id: 0,
    idNum: null,
    name: null,
    num: null
  },
  setId0(){
    this.setData({id: 0});
  },
  setId1(){
    this.setData({id: 1});
  },
  setId2(){
    this.setData({id: 2});
  },
  setId3(){
    this.setData({id: 3});
  },
  addPatient(){
    getApp().globalData.patients.push({
      name: this.data.name,
      sex: '男',
      id: this.data.idNum,
      num: this.data.num,
      age: 25
    });
    wx.showToast({
      title: '添加成功',
      icon: 'success'
    });
    setTimeout(() => {
      wx.navigateBack({
        delta: 0,
      });
    },600)
  }
})